package com.dreamcar.auction.enums;

public enum RequestStatusEnum {
	OPEN("OPEN"), CLOSED("CLOSED"), SCHEDULED("SCHEDULED");
	
	private final String status;
	
	private RequestStatusEnum(String status) {
		this.status = status;
	}
	
	public static RequestStatusEnum fromValue(String value){
		if(value!=null){
			for (RequestStatusEnum statusEnum : values()) {
				if(statusEnum.status.equals(value)){
					return statusEnum;
				}
			}
		}
		throw new IllegalArgumentException("El valor requerido no se encuentra en RequestStatusEnum:"+value);
	}
	
	public String toValue(){
		return status;
	}

}
